<?php
	// $this->Items = array_merge($this->Items, $this->Items, $this->Items, $this->Items,$this->Items);
	// $this->Items = array_merge($this->Items, $this->Items, $this->Items, $this->Items,$this->Items);
	$linkGetContent = $this->cmsUrl(array(
										'module' => 'default',
										'controller' => 'scripts',
										'action' => 'get-content-url'
										));
?>
<div class="row">
    <div class="box">
    <?php
    	if(!empty($this->Items)){
    		$i = 0;
    		foreach($this->Items as $k => $v){
    			$id		= $v['id'];
				$name	= Zendvn_Filter_Filter::filterContent($v['full_name'], 'filter');
    			$url	= $v['website'];
				if(empty($name)){
					$name = $url;
				}
				$linkGetContent = $this->cmsUrl(array(
										'module' => 'default',
										'controller' => 'scripts',
										'action' => 'get-content-url',
										'url' => urlencode($url),
										'id_item' => $id
										));
				echo '<div class="col-xs-6 col-sm-3 row-item">
						<p class="text-primary">
							<a title="" target="_blank" rel="' . $linkGetContent . '" class="item-name" id="' . $id . '" href="'.$url.'">' . $name . '</a></p>
					  </div>';
				$i++;
				if($i == 4){
					echo '<div class="clearfix visible-xs"></div>';
					$i = 0;	
				}
			}
			if($i < 4){
				echo '<div class="clearfix visible-xs"></div>';
				$i = 0;	
			}
		}
    ?> 
    	<div class="clr"></div>
    	<div class="col-xs-6 col-md-4">
	    	<?php 
				$arrParam = array(
						'module' => 'default',
						'controller' => 'index',
						'action' => 'index'
				);
				echo $this->paginationControl($this->panigator,'Sliding','paning.php',array('arrParam'=>$arrParam));
			?>
		</div>
		<div class="clearfix visible-xs"></div>
    </div>
</div>


<?php
	$linkIconLoading = FILE_URL . '/images/icon_loadingBar_trans.gif';
	$linkGetContent = $this->cmsUrl(array(
										'module' => 'default',
										'controller' => 'scripts',
										'action' => 'get-content-url'
										));
?>

<script>
$(function(){
	$('.item-name').cluetip({
						tracking		: true,
						cluetipClass	: 'rounded',
						showTitle		: false,
						width			: '600px',
						ajaxCache		: false
						});
	
	
	// $.widget.bridge('uitooltip', $.ui.tooltip);
	// var request;
	// $('.text-primary').uitooltip({
							// 'track'		: true,
					      	// 'position'	: { 
					      			// my: 'left+15 top', 
					      			// at: 'right top' },
					      	// 'content'	: function(callback){
					      		// callback('<img src="' + '<?php echo $linkIconLoading?>' +'" />');
					      		// var element = $(this);
					      		// var url = element.children('a').attr('href');
					      		// var id_item = element.children('a').attr('id');
					      		// delay(function(){
					      			// request = $.post('<?php echo $linkGetContent?>', {url:url, id_item:id_item}, function(data){
						      			// callback(data);
						      		// })
					      		// }, 1500)	
					      	// },
					      	// 'close'		: function( event, ui ) {
					      		// request.abort();
					      	// }
					    // });
});
</script>
